﻿<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="库存查询" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		window.close();
	}
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			var len=${fn:length(list)};
			var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
			document.getElementById("noPrinSpan").style.display="none";
			if(len>200 && isIE){
				iePrint("wb","${enterpriseInfo.doPrint}");
			}else{
				printContent("管理易-当前库存","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			}
			document.getElementById("noPrinSpan").style.display="";
		}
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td height="40px" align="center" class="FontLarge_Bold">${licenseInfo.enterpriseName} 当前库存</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" width="20%">仓库：${stoName}</td>
			      	<td class="FontSmall" colspan="2" width="80%" align="right" >材料类别：${ptName}
						<c:if test="${proCode!=null && proCode!=''}">材料编号：<c:out value="${proCode}" /></c:if>
						<c:if test="${proName!=null && proName!=''}">品名规格：<c:out value="${proName}" /></c:if>
					</td>
				</tr>
				<tr class="ListTrPrint">
			      	<td class="FontSmall" width="20%">库存范围：${amountName}</td>	
			      	<td class="FontSmall" width="40%" align="center" ><c:if test="${costType=='SHOW_COST' && (currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';NO_TOTA;')==-1 && fn:indexOf(currentUser.privs,';STOR_COST;')!=-1)}">金额合计：${cost}元</c:if></td>				      	      	
			      	<td class="FontSmall" width="40%" align="right">查询时间：<fmt:formatDate value="${searchTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				</tr>				
		  </table>
		</td>
	</tr>
	<tr>
		<td>			
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td class="ListTd FontSmall_Bold"  align="center" width="14%">材料编号</td>
					<td class="ListTd FontSmall_Bold"  align="center" width="26%">品名规格</td>
					<c:if test="${costType=='SHOW_COST' && (currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';STOR_COST;')!=-1)}">
						<td class="ListTd FontSmall_Bold"  align="center" width="8%">单位</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="8%">数量</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="8%">单价</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="10%">金额</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="8%">安全库存</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="8%">最高库存</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="10%">所在仓库</td>
					</c:if>
					<c:if test="${costType!='SHOW_COST' || (currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';STOR_COST;')==-1)}">
						<td class="ListTd FontSmall_Bold"  align="center" width="12%">单位</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="12%">数量</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="12%">安全库存</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="12%">最高库存</td>
						<td class="ListTd FontSmall_Bold"  align="center" width="12%">所在仓库</td>
					</c:if>
				</tr>
				<c:forEach var="item" items="${list}" varStatus="i">
				<tr class="ListTrPrint">
				  	<td class="FontSmall" align="center">${item.product.productCode}</td>
				  	<td class="FontSmall" align="center">${item.product.productName} ${item.product.specification} ${item.product.marque}</td>
				  	<td class="FontSmall" align="center">${item.product.unit}</td>
				  	<td class="FontSmall" align="right" ><commonTag:parseBigDecimal source="${item.stock.amount}" /></td>
				  	<c:if test="${costType=='SHOW_COST' && (currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';STOR_COST;')!=-1)}">
					  	<td class="FontSmall" align="right" ><commonTag:parseBigDecimal source="${item.unitPrice}" /></td>
					  	<td class="FontSmall" align="right" ><commonTag:parseBigDecimal source="${item.stock.cost}" /></td>
				  	</c:if>
					<td class="FontSmall" align="right" >${item.product.minLimit}</td>
					<td class="FontSmall" align="right" >${item.product.maxLimit}</td>
					<td class="FontSmall" align="center">${item.stoName}</td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	<tr id="noPrinSpan">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value="开始打印" onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>